#include <iostream>

using namespace std;

class Complex;

class Point
{
public:
    Point(int x, int y);
    operator int();

private:
    int _ix;
    int _iy;
};

class Complex
{
public:
    operator Point();
    Complex(int real, int image);

private:
    int _real;
    int _image;
};

Point::Point(int x, int y): _ix(x), _iy(y)
{}

Point::operator int()
{
    return this->_ix + this->_iy;
}

Complex::operator Point()
{
    return Point(_real, _image);
}

Complex::Complex(int real, int image): _real(real), _image(image)
{}

void test()
{
    Complex c(3,4);
    Point p = c;
    int i = p;

    cout << "i = " << i << endl;
}

int main()
{
    test();
    return 0;
}

